<template>
  <div>
    <el-card style="background-color:#F1F1F1;height:600px;overflow-y: auto">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="车号:">
          <el-select v-model="formInline.carNumber" placeholder="请选择车号" class="form-item">
            <el-option label="1221" value="1221" />
            <el-option label="其他" value="其他" />
          </el-select>
        </el-form-item>
        <el-form-item label="车型:">
          <el-select v-model="formInline.carType" placeholder="请选择车型" class="form-item">
            <el-option label="HXD2" value="HXD2" />
            <el-option label="其他" value="其他" />
          </el-select>
        </el-form-item>
        <el-form-item label="起始时间:">
          <el-date-picker
            v-model="formInline.startDate"
            class="form-item"
            type="date"
            placeholder="选择日期"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd"
          />
        </el-form-item>
        <el-form-item label="终止时间:">
          <el-date-picker
            v-model="formInline.endDate"
            class="form-item"
            type="date"
            placeholder="选择日期"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd"
          />
        </el-form-item>
        <el-form-item class="form-item">
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>

      <el-table
        :data="tableData"
        style="width: 100%; "
        :default-sort="{prop: 'downloadTime', order: 'descending'}"
        border
      >
        <el-table-column
          prop="downloadCarType"
          label="下载机车车型"
          sortable
        />
        <el-table-column
          prop="carNumber"
          label="车号"
          sortable
        />
        <el-table-column
          prop="operator"
          label="操作者"
          sortable
        />
        <el-table-column
          prop="downloadTime"
          label="下载时间"
          sortable
        />
        <el-table-column
          prop="downloadFileCount"
          label="下载文件数"
          sortable
        />
        <el-table-column
          prop="downloadDataSize"
          label="下载数据大小"
          sortable
        />
        <el-table-column
          prop="resolvedFaultCount"
          label="解析出故障数量"
          sortable
        />
        <el-table-column
          prop="selectedFaultCount"
          label="筛选出数量"
          sortable
        />
        <el-table-column
          prop="diagnosedFaultCount"
          label="诊断故障数量"
          sortable
        />
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        carNumber: '',
        carType: '',
        startDate: '',
        endDate: ''
      },
      tableData: [{
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      },
      {
        downloadCarType: 'HXD2',
        carNumber: '1044A',
        operator: '前台',
        downloadTime: '2024-3-7 16:29:22',
        downloadFileCount: '1',
        downloadDataSize: '174059',
        resolvedFaultCount: '未完成',
        selectedFaultCount: '未完成',
        diagnosedFaultCount: '未完成'
      }
      ]
    }
  },
  methods: {
    onSubmit() {
      console.log('submit!')
      // 在这里可以添加查询逻辑
    }
  }
}
</script>

<style scoped>
.box-card {
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: bold;
}

.demo-form-inline {

  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.form-item {
  margin-right: 10px;
  width: 150px;
}

.demo-form-inline .el-button {
  margin-left: 10px;
}

.el-table {
  border-radius: 4px;
}
</style>
